{extend name='base'}
{block name='content'}
    <!--页面主要内容-->
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <h4>视频列表</h4>
                    </div>
                    <div class="panel panel-cyan">
                        <div class="panel-heading" role="tab" id="headingThree">
                            <h4 class="panel-title">
                                <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
                                   所属课程： {$pro_name}
                                </a>
                            </h4>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>视频编号</th>
                                    <th>视频名称</th>
                                    <th>视频排序</th>
                                    <th>视频url</th>
                                    <th width="200">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $videoList as $v}
                                <tr>
                                    <td>{$v.video_id}</td>
                                    <td>{$v.video_name}</td>
                                    <td>{$v.video_sort}</td>
                                    <td>{$v.video_url}</td>
                                    <td>
                                        <div class="btn-group">
                                            <a class="btn btn-xs btn-default"  onclick="openvideo('{$v.video_url}')"><i class="mdi mdi-play"></i>试看</a>
                                            <a class="btn btn-xs btn-default" href="{:url('admin/video/delete',['id'=>$v.video_id])}" ><i class="mdi mdi-delete-forever"></i>删除视频</a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}

                                </tbody>
                            </table>
                        </div>


                    </div>
                </div>
            </div>

        </div>

    </div>

</main>
    <!--End 页面主要内容-->
<script>
    layui.use('layer', function(){
        var layer = layui.layer;

    };
</script>
<script>
    function openvideo(url){
        layer.open({
            title:"播放视频",
            type: 2,
            content: url,
            area: ['600px', '400px']
        });
    }

</script>
{/block}